/**
 * @Author: Joe
 * @Date: 2020/10/15 0015 下午 5:10
 * 懒汉模式双重校订
 */
public class Singleton2 {
    private static volatile Singleton2 instance;
    private Singleton2(){};
    public static Singleton2 getInstance(){
        if(instance == null){
            synchronized (Singleton2.class){
                if(instance == null){
                    instance = new Singleton2();
                }
            }
        }
        return instance;
    }

}
